 //本地存储一些购物车的数据防止刷新导致数据丢失
 import $store from './../../store';

 function storageCar() {
   if ($store.state.buyTicket.carTicketSumList.length === 0) {
     let storageCarUcan = JSON.parse(sessionStorage.getItem('storageCarUcan')) || {};
     $store.state.buyTicket.carTicketList = storageCarUcan.carTicketList || [];
     $store.state.buyTicket.carTicketSumList = storageCarUcan.carTicketSumList || [];
     $store.state.buyTicket.totalPrice = storageCarUcan.totalPrice || 0;
     $store.state.buyTicket.actualPrice = storageCarUcan.actualPrice || 0;
   } else {
     let storageCarUcan = {
       carTicketList: $store.state.buyTicket.carTicketList,
       carTicketSumList: $store.state.buyTicket.carTicketSumList,
       totalPrice: $store.state.buyTicket.totalPrice,
       actualPrice: $store.state.buyTicket.actualPrice
     };
     sessionStorage.setItem('storageCarUcan', JSON.stringify(storageCarUcan));
   }
 }

 export {
   storageCar
 };
